package API.DAY11.reflect;

import API.DAY11.reflect.annotation.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo11 {
    public static void main(String[] args) throws Exception{
        Class cls = Class.forName("API.DAY11.reflect.Person");
        Method method = cls.getMethod("sayHello");
        if(method.isAnnotationPresent(AutoRunMethod.class)){
            System.out.println("该方法被标注了");
        }else {
            System.out.println("该方法没有被标注");
        }
    }
}
